home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / PNL Libraries / MyAEDump.p < prev    next >
Text File  |  1993-10-01  |  728b  |  39 lines

  1. unit MyAEDump;
  2.  
  3. interface
  4.  
  5.     uses
  6.         AppleEvents;
  7.  
  8.     procedure DumpAppleEvent (event: AppleEvent);
  9.  
  10. implementation
  11.  
  12.     uses
  13.         MyDumping;
  14.  
  15.     procedure DumpAppleEvent (event: AppleEvent);
  16.         var
  17.             err, junk: OSErr;
  18.             index: integer;
  19.             desc: AEDesc;
  20.             key: AEKeyword;
  21.     begin
  22.         DumpLine('AppleEvent is:');
  23.         index := 1;
  24.         repeat
  25.             err := AEGetNthDesc(event, index, typeWildCard, key, desc);
  26.             if err = noErr then begin
  27.                 DumpLine(StringOf(key, ': ', desc.descriptorType));
  28.                 if desc.dataHandle <> nil then begin
  29.                     HLock(desc.dataHandle);
  30.                     DumpData(desc.dataHandle^, GetHandleSize(desc.dataHandle));
  31.                 end;
  32.                 junk := AEDisposeDesc(desc);
  33.                 index := index + 1;
  34.             end;
  35.         until err <> noErr;
  36.         DumpLine('');
  37.     end;
  38.  
  39. end.